package admin

import "github.com/google/uuid"

type GetSystemPromptsResponse struct {
	Rows  []SystemPromptRow `json:"rows"`
	Total int               `json:"total"`
}

type SystemPromptRow struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	Content   string    `json:"content"`
	IsActive  bool      `json:"is_active"`
	CreatedAt int64     `json:"created_at"`
	UpdatedAt int64     `json:"updated_at"`
}

type CreateSystemPromptRequest struct {
	Name     string `json:"name" validate:"required,min=1,max=100"`
	Content  string `json:"content" validate:"required,min=1,max=5000"`
	IsActive bool   `json:"is_active"`
}

type CreateSystemPromptResponse struct {
	ID       uuid.UUID `json:"id"`
	Name     string    `json:"name"`
	IsActive bool      `json:"is_active"`
}

type UpdateSystemPromptRequest struct {
	ID       uuid.UUID `param:"id" validate:"required,uuid"`
	Name     *string   `json:"name" validate:"omitempty,min=1,max=100"`
	Content  *string   `json:"content" validate:"omitempty,min=1,max=5000"`
	IsActive *bool     `json:"is_active"`
}

type DeleteSystemPromptByIdRequest struct {
	ID uuid.UUID `param:"id" validate:"required,uuid"`
}

type SetActiveSystemPromptByIdRequest struct {
	ID uuid.UUID `param:"id" validate:"required,uuid"`
}

type GetTokenUsageStatsRequest struct {
	StartDate string `json:"start_date" validate:"omitempty"`
	EndDate   string `json:"end_date" validate:"omitempty"`
}

type GetTokenUsageStatsResponse struct {
	Summary    TokenUsageSummary `json:"summary"`
	DailyStats []DailyStats      `json:"daily_stats"`
	UserStats  []UserStats       `json:"user_stats"`
}

type TokenUsageSummary struct {
	TotalTokens         int64   `json:"total_tokens"`
	TotalMessages       int64   `json:"total_messages"`
	AvgTokensPerMessage float64 `json:"avg_tokens_per_message"`
}

type DailyStats struct {
	Date         string `json:"date"`
	TokensUsed   int64  `json:"tokens_used"`
	MessageCount int64  `json:"message_count"`
}

type UserStats struct {
	UserID       uint   `json:"user_id"`
	Username     string `json:"username"`
	TokensUsed   int64  `json:"tokens_used"`
	MessageCount int64  `json:"message_count"`
}
